home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4682 < prev    next >
Encoding:
Text File  |  1996-08-06  |  792 b   |  29 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.sprintlink.net!news1!MAUI
  3. From: jeffl@inter-intelli.com (Jeff Lindholm)
  4. Subject: Re: Stupid Q: what's wrong?
  5. X-Nntp-Posting-Host: inter6.inter-intelli.com
  6. Message-ID: <DM1wpD.Lqp@iquest.net>
  7. To: paveltka@unix.infoserve.net
  8. Sender: news@iquest.net (News Admin)
  9. Organization: Interactive Intelligence, Inc.
  10. X-Newsreader: News Xpress Version 1.0 Beta #3
  11. References: <4ejerd$r84@news.infoserve.net>
  12. Date: Wed, 31 Jan 1996 18:07:04 GMT
  13.  
  14. char c;
  15. c = *ptr;
  16. strcat(szC,&c); // will start at address of c and move until it hits a '\0' 
  17. in memory somewhere
  18.  
  19. That will most likely step on the stack. By throwing in a cout << you are 
  20. pushing the stack around. If you really need to do the above try.
  21.  
  22. char c[2];
  23. c[1] = '\0';
  24. .
  25. other code
  26. .
  27. *c = *ptr;
  28. strcat(sz, c);
  29.